BUG_ON(per_cpu(timer_irq, 0) < 0);
}
+static struct vcpu_set_periodic_timer xen_set_periodic_tick = {
+ .period_ns = NS_PER_TICK
+};
+
void __init time_init(void)
{
#ifdef CONFIG_HPET_TIMER
return;
}
#endif
+
+ HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, 0,
+ &xen_set_periodic_tick);
+
get_time_values_from_xen(0);
processed_system_time = per_cpu(shadow_time, 0).system_timestamp;
*/
static void stop_hz_timer(void)
{
+ struct vcpu_set_singleshot_timer singleshot;
unsigned int cpu = smp_processor_id();
unsigned long j;
+ int rc;
cpu_set(cpu, nohz_cpu_mask);
j = jiffies + 1;
}
- if (HYPERVISOR_set_timer_op(jiffies_to_st(j)) != 0)
- BUG();
+ singleshot.timeout_abs_ns = jiffies_to_st(j);
+ rc = HYPERVISOR_vcpu_op(VCPUOP_set_singleshot_timer, cpu, &singleshot);
+#ifdef XEN_COMPAT_030004
+ if (rc) {
+ BUG_ON(rc != -ENOSYS);
+ rc = HYPERVISOR_set_timer_op(singleshot.timeout_abs_ns);
+ }
+#endif
+ BUG_ON(rc);
}
static void start_hz_timer(void)
init_cpu_khz();
for_each_online_cpu(cpu) {
+ HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu,
+ &xen_set_periodic_tick);
get_time_values_from_xen(cpu);
per_cpu(processed_system_time, cpu) =
per_cpu(shadow_time, 0).system_timestamp;
BUG_ON(cpu == 0);
+ HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu,
+ &xen_set_periodic_tick);
+
do {
seq = read_seqbegin(&xtime_lock);
/* Use cpu0 timestamp: cpu's shadow is not initialised yet. */
config XEN_COMPAT_030002_AND_LATER
bool "3.0.2 and later"
+ config XEN_COMPAT_030004_AND_LATER
+ bool "3.0.4 and later"
+
config XEN_COMPAT_LATEST_ONLY
bool "no compatibility code"
bool
default XEN_COMPAT_030002_AND_LATER
+config XEN_COMPAT_030004
+ bool
+ default XEN_COMPAT_030002_AND_LATER || XEN_COMPAT_030004_AND_LATER
+
endmenu
config HAVE_IRQ_IGNORE_UNHANDLED